home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / vidhandl / detect.cpp < prev    next >
C/C++ Source or Header  |  1999-02-03  |  1KB  |  29 lines

  1. /* DETECT - Displays current video status                           */
  2. /* Freeware version                                                 */
  3. /* By Marcio Afonso Arimura Fialho                                  */
  4. /* http://pessoal.iconet.com.br/jlfialho                            */
  5. /* e-mail: jlfialho@iconet.com.br or (alternate) jlfialho@yahoo.com */
  6.  
  7. #include <crt.h>
  8. #include <stdio.h>
  9.  
  10. #define CGA  1
  11. #define MCGA 2
  12. #define EGA  3
  13. #define VGA  4
  14.  
  15. void main ()
  16.  {
  17.     char *msg[2]={"Text","Graphics"};
  18.     crt_detect(VGA); //if your video adapter isn't VGA or SVGA+, replace
  19.                           //crt_detect input argument
  20.     printf ("\n\tCurrent video mode = %d (%.2X)h (%s mode)\n",
  21.       (unsigned char)vmode_mode,(unsigned char)vmode_mode,msg[crt_direct]);
  22.     if (!crt_direct)
  23.      {
  24.         printf ("\tCurrent video page = %d\n",crt_page);
  25.         printf ("\tCurrent video page base address = %Fp\n",video_addr);
  26.      }
  27.     printf ("\tNumber of screen columns = %d\n",vmode_x);
  28.     printf ("\tNumber of screen rows = %d\n",vmode_y);
  29.  }